/*
 * @Author       : Hejh(3010733382@qq.com)
 * @Version      : V1.0
 * @Date         : 2024-01-30 11:01:15
 * @Description  : 考试记录相关接口
 */

import type {
  ExamHistoryCreateReq,
  ExamHistoryPageRes,
  ExamHistoryReq,
  ExamHistoryUpdateReq
} from '@/types/examHistory'
import request from '@/utils/request'

// 分页查询考试记录接口
export const getExamHistoryByPage = (params?: ExamHistoryReq) => {
  return request.get<ExamHistoryPageRes>('/examHistory/list', { params })
}

// 分页查询考试记录接口
export const getAuthExamHistoryByPage = (params?: ExamHistoryReq) => {
  return request.get<ExamHistoryPageRes>('/examHistory/auth/list', { params })
}

// 添加考试记录接口
export const createExamHistory = (data: ExamHistoryCreateReq) => {
  return request.post('/examHistory/create', data)
}

// 更新考试记录接口
export const updateExamHistory = (data: ExamHistoryUpdateReq) => {
  return request.put('/examHistory/update', data)
}

// 考试记录排序接口
export const sortExamHistory = (examHistoryIds: string[]) => {
  return request.put('/examHistory/sort', { examHistoryIds })
}

// 考试记录删除接口
export const delExamHistory = (examHistoryIds: string[], picCode?: string) => {
  return request.delete('/examHistory/delete', { data: { examHistoryIds, picCode } })
}
